import { service } from "./Request";
import qs from "qs";

const ordersApi = {
    // 获取所有订单
    getOrders(params) {
        return service({
            url: "/admin/orders",
            method: "get",
            params
        })
    },
    // 获取订单详情
    getOrderDetail(id) {
        return service({
            url: `/admin/orders/${id}`,
            method: "get"
        })
    },
    // 更新订单
    updateOrder(id, data) {
        return service({
            url: `/admin/orders/${id}`,
            method: "put",
            data
        })
    },
    // 删除订单
    deleteOrder(id) {
        return service({
            url: `/admin/orders/${id}`,
            method: "delete"
        })
    }
};

export default ordersApi; 